<?php

class StringTools {
	public function __construct(){}
	static function hex($n, $digits) {
		$s = dechex($n);
		if($digits !== null) {
			$s = str_pad($s, $digits, "0", STR_PAD_LEFT);
		}
		return strtoupper($s);
	}
	function __toString() { return 'StringTools'; }
}
